/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef PATTERN_H
#define PATTERN_H

#include <vector>
#include <NoCopy.h>
#include <resource/Resource.h>

struct Note
{
	unsigned char note;
	unsigned char instrument;
	unsigned char volume;
	unsigned char effect;
	unsigned char effect_parameter;

	Note()
	:	note( 0 ),
		instrument( 0 ),
		volume( 0 ),
		effect( 0 ),
		effect_parameter( 0 )
	{}
};

class XMPattern
{
	class Row : public std::vector< Note >
	{};
	std::vector< Row > rows;
public:
	XMPattern( int channels, resource::Resource * resource );
	const Note & get_note( int row, int channel )const
	{
		return rows[row][channel];
	}
	int get_rows_count()const
	{
		return rows.size();
	}
};

#endif